package com.xiong.fan.singleton;

public class LazyThree {
    private static boolean initialized = false;

    private LazyThree(){
        synchronized (LazyThree.class){
            if(initialized==false){
                initialized=!initialized;
            }else {
                throw new RuntimeException("单例已被侵犯");
            }
        }

    }

    public static final  LazyThree getInstance(){
        return LazyHolder.LAZY;
    }

    static class LazyHolder{
        static  final LazyThree LAZY = new LazyThree();
    }

}
